<script setup>
import { onMounted, ref } from 'vue'
import * as echarts from 'echarts'
const titleDemo = ref(null)
onMounted(() => {
  const titleEcharts = echarts.init(titleDemo.value)
  const option = {
    title: {
      text: `衣服销量-{bold|5月}`,
      textStyle: {
        rich: {
          bold: {
            fontWeight: '900',
            fontSize: 30
          }
        }
      }
    },
    tooltip: {},
    xAxis: {
      data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
      type: 'category'
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20]
      }
    ]
  }
  titleEcharts.setOption(option)
})
</script>
<template>
  <div ref="titleDemo" class="title-demo"></div>
</template>
<style lang="scss" scoped>
.title-demo {
  width: 500px;
  height: 500px;
  background-color: lightblue;
}
</style>
